{template 'search', 'header'}
<style type="text/css"> 
<!--
html{background-position:0 -120px}
.sr_infoul{margin-left: 160px;width: 425px;}
--> 
</style>
</head>
<body class="search-body">
	<!-- header start -->
	<div class="so-header">
		<h2 class="so-logo-small"><a href="{U('search')}"><img src="{$IMG_PATH}search/so_logo_small.gif" alt="搜索"></a></h2>
		<form name="search" id="searchform">
			<input type="hidden" name="app" value="search"/>
			<input type="hidden" name="controller" value="index"/>
			<input type="hidden" name="action" value="init"/>
			<input type="hidden" name="typeid" value="{$typeid}" id="typeid"/>
			<div class="so-tab" id="search">
				{php $j=0}
				{loop $search_model $k=>$v}
				{php $j++;}
				<a href="javascript:;" onClick="setmodel({$v['typeid']}, $(this));" {if $typeid == $v['typeid']} class="on" {/if}>{$v['name']}</a>
				{/loop}
				{php unset($j);}
			</div>
			<div class="so-input-ct">
				<input type="text" name="q" id="q" class="so-key" value='{$search_q}' size="42"  />
				<input type="submit" class="so-submit" value="" onMouseOver="setCls(this,'so-submit-over');" onMouseOut="setCls(this,'so-submit-over',1);setCls(this,'so-submit-click',1);" onMouseDown="setCls(this,'so-submit-click');" onMouseUp="setCls(this,'so-submit-click',1);">
			</div>
			<div id="sr_infos" class="sr_infoul">
        	</div>
		</form>
	</div>
	<!-- header end -->
	<!-- main start -->
	<div class="clearfix">
		<!-- main left start -->
		<div class="so-left">
			<div>
				<ul>
					{loop $search_model $k=>$v}
					{if $v['typeid']==$typeid}<li class="current">{$v['name']}</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$v['typeid']}&q={$search_q}&time={$time}" >{$v['name']}</a></li>{/if}
					{/loop}
				</ul>
				<ul>
					{if $time=='all' || empty($time)}<li class="current">全部时间</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$search_q}&time=all" >全部时间</a></li>{/if}{if $time=='day'}<li class="current">一天内</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$search_q}&time=day" >一天内</a></li>{/if}
					{if $time=='week'}<li class="current">一周内</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$search_q}&time=week" >一周内</a></li>{/if}
					{if $time=='month'}<li class="current">一月内</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$search_q}&time=month" >一月内</a></li>{/if}
					{if $time=='year'}<li class="current">一年内</li>{else}<li><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$search_q}&time=year" >一年内</a></li>{/if}
				</ul>
				<ul id='history_ul'>
				
                </ul>
			</div>
			<p class="so-trigger"><span onClick="triggerSoLeft(this)"></span></p>
		</div>
		<!-- main left end -->
		<!-- main body start -->
		<div class="so-list-body">
			{if empty($data)}
			<div class="stitle">
				<a href="{U('search')}">搜索首页</a>
			</div>
			<div class="nodata">
				抱歉，没有找到与“<font color='#cc0000'>{$search_q}</font>” 相关的内容。<br><br>
				<strong>建议您：</strong>
				<li>看看输入的文字是否有误</li> 
				<li>去掉可能不必要的字词，如“的”、“什么”等</li> 
			</div>
			{else}
			<div class="stitle">
				找到约 {$totalnums} 条结果 （用时{sprintf("%01.2f", $execute_time)} 秒）
			</div>
			<div class="so-list">
				<ul>{loop $data $i $r}
					<li>
						<div>
							{if $r['thumb']}<a href="{$r[url]}"><img src="{$r[thumb]}" width="55" height="55" /></a>{/if}
							<h3><a href="{$r[url]}" target="_blank">{$r[title]}</a>{if $r['posids']}<img src="{IMG_PATH}icon/small_elite.gif">{/if}</h3>
							<div class="desc">{str_cut($r[description],70)}</div>
						</div>
						<div class="url">
							<a href="{$r[url]}" target="_blank">{$r[url]}</a> -- {Format::date($r[inputtime], 1)}
						</div>
						
					</li>{/loop}
				</ul>
			</div>
			<div class="pager">{$pages}</div>
			<!-- {if $setting['relationenble']} 相关搜索 start -->
			<div class="likewords"> 
				<h5 class="t">相关搜索</h5>
				<table cellspacing="0" cellpadding="0" border="0" class="bd">
					<tbody>
						<tr>
						{loop $relation $k $v}
							<td><a href="?app=search&controller=index&action=init&typeid={$typeid}&q={$v['keyword']}">{$v['keyword']}</a></td>
						{/loop}
						</tr>
					</tbody>
				</table>
				<div class="clear"></div>
			</div>
			<!-- {/if}相关搜索 start -->
			{/if}
		</div>
	</div>
	<!-- main end -->
<script type="text/javascript" src="{JS_PATH}search_history.js"></script>
{if $setting['suggestenable']}
<script type="text/javascript" src="{JS_PATH}jquery.suggest.js"></script>
<script type="text/javascript" src="{JS_PATH}search_suggest.js"></script>
{/if}
{template 'search', 'footer'}

